import React, { FC, useContext, useEffect, useState } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import AVatar from './Avatar/Avatar';
import NickName from './NickName/NickName';
import Other from './Other/Other';
import { ChagePersonalInfoContext } from '../ChagePersonalInfoContext';

export interface IProps extends ICompProps {}
BaseInfo.defaultProps = {} as Partial<IProps>;
function BaseInfo(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('BaseInfo', className);
    const { userInfo } = useContext(ChagePersonalInfoContext);

    return (
        <RootView className={localClassName} style={style}>
            <AVatar></AVatar>
            <NickName></NickName>
            <Other userInfo={userInfo}></Other>
        </RootView>
    );
}
export default React.memo(BaseInfo as FC<IProps>);
const RootView = styled(View)`
    &.BaseInfo {
        padding: 40px;

    }
`;
